package com.teamsea;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;

public class Main {
    public static void main(String[] args) {

        // 创建一个Bean工厂
        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();

        // 创建一个读取器
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory);

        // 读取工厂中的配置
        reader.loadBeanDefinitions("beans.xml");

        // 获取Bean对象
        Object object = beanFactory.getBean("carFactory");

        System.out.println(object.getClass().getName());

    }
}